package demo;

import java.util.HashMap;
import java.util.ArrayList;
import java.util.List;

public class java006 {
    public static void main(String[] args) {
        int[] a = {1, 2, 3};
        int[] b = {3, 4, 5, 2};
        HashMap<Integer, Integer> elementCount = new HashMap<>();

        for (int num : a) {
            elementCount.put(num, elementCount.getOrDefault(num, 0) + 1);
        }

        for (int num : b) {
            elementCount.put(num, elementCount.getOrDefault(num, 0) + 1);
        }

        List<Integer> resultList = new ArrayList<>();

        for (int num : elementCount.keySet()) {
            if (elementCount.get(num) == 1) {
                resultList.add(num);
            }
        }

        for (int num : resultList) {
            System.out.print(num + " ");
        }
    }
}
